package com.coolwen.spring.base;

/**
 * @author CoolWen
 * @version 2020-03-05 9:13
 */
public class Knight extends Base {
    private String name;
    private Weapon weapon;


    public Knight() {
    }

    public Knight(String name, Weapon weapon) {
        this.name = name;
        this.weapon = weapon;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Weapon getWeapon() {
        return weapon;
    }
    @Inject
    public void setWeapon(Weapon weapon) {
        this.weapon = weapon;
    }

    public void fight() {
        System.out.println(name + "开始攻击了");
        weapon.attck();
    }
}
